var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    Mixed = mongoose.Schema.Types.Mixed;

/**
 * 练习
 *
 * @type {exports.Mixed|*}
 */
var Practice = new Schema({
    store : {type: Schema.Types.ObjectId, ref: 'Store'}, //题库
    paper : {type: Schema.Types.ObjectId, ref: 'Paper'}, //试卷
    user : {type: Schema.Types.ObjectId, ref: 'User'}, //练习人

    status: String,  //挑战状态：N - 未开始 F - 已经完成 I - 正在进行中

    start: Date, //开始时间
    end: Date, //结束时间

    myScore : Number, //得分
    myResults : Mixed,  //用户的答案记录

    createTime: Date //该对战的创建时间
});

mongoose.model('Practice', Practice, 'practices');
